from mcp.server.fastmcp import FastMCP
import os

mcp = FastMCP("file-manager", log_level="INFO")

@mcp.tool()
def list_files(path: str) -> list:
    """获取指定目录下的文件列表"""
    return os.listdir(os.path.expanduser(path))

if __name__ == "__main__":
    mcp.run(transport='http', port=8080)